//
//  MeiView.m
//  MyProject
//
//  Created by dllo on 15/11/17.
//  Copyright © 2015年 蓝鸥0825. All rights reserved.
//

#import "MeiView.h"
#import "MeiTableCell.h"

#define WIDTH self.frame.size.width
#define HEIGHT self.frame.size.height


@implementation MeiView

- (instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        [self create];
    }
    return self;
}



- (void)create{
    
    self.table = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
    [self addSubview:self.table];
    self.table.dataSource = self;
    self.table.delegate = self;
    self.table.rowHeight = HEIGHT;
    self.table.bounces = NO;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.array.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *reuse = @"reuse";
    self.cell = [tableView dequeueReusableCellWithIdentifier:reuse];
    if (!self.cell) {
        self.cell = [[MeiTableCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuse];
    }
    self.cell.viewF.VC = self.VC;
    self.cell.viewS.VC = self.VC;
    self.cell.model = self.array[indexPath.row];
    self.cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return self.cell;
}


//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
//    return self.array.count;
//}

//- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
//        
//        if (section == 0) {
//            MeiModel *model = [[MeiModel alloc] init];
//            model = self.array[0];
//            return model.title;
//        }
//    return nil;
//    }

    
    
    
    
    
    







@end
